import request from '@/utils/request.js'

const categoryApi = {
    selectAll() {
        return request.get('/category/selectAll')
    },
    list(categoryQuery) {
        return request.get('/category/list', {params: categoryQuery})
    },
    deleteById(id) {
        return request.delete(`/category/deleteById/${id}`)
    },
    deleteAll(ids) {
        return request.delete(`/category/deleteAll/${ids}`)
    },
    add(category) {
        return request.post(`/category/add`, category)
    },
    selectById(id) {
        return request.get(`/category/selectById/${id}`)
    },
    update(category) {
        return request.put(`/category/update`, category)
    }
}

export default categoryApi